package com.example.chapter13;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/*
* 13.3.案例实施-读取文件内容
* */
public class FileReadExample {
    public static void main(String[] args) {
        String filePath = "path/to/your/file.txt";
        try {
            List<String> lines = Files.readAllLines(Paths.get(filePath));
            for (String line : lines) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
